export default function keyboardEvent(_this,length) {
	document.onkeydown=(event)=>{
		if(_this.dialogFormVisible.bool){
		    var e = event || window.event || arguments.callee.caller.arguments[0];
		    if(e && e.keyCode==37){ // 按左键 
		  		//console.log(37)
		  		if(_this.activeName!=1){
		  			_this.activeName=((_this.activeName-0)-1).toString()
		  		}else{
		  			_this.activeName=length.toString()
		  		}
		  		
		  	}
		    if(e && e.keyCode==39){ // 按右键
		        //console.log(39)
		        if(_this.activeName!=length){
		  			_this.activeName=((_this.activeName-0)+1).toString()
		  		}else{
		  			_this.activeName="1"
		  		}
		    }      
	    }
	}; 
}          
